import Vue from 'vue'
import App from './App.vue'
import router from './router'
// 引入api暴露出来的axios
// import { allChannelListAPI } from '@/api'
import store from './store'
// 引入移动端适配插件
import 'amfe-flexible'
// 引入vant组件
import {
  NavBar, Form, Field, Button, Tabbar, TabbarItem, Row, Col, Badge,
  Icon, Tab, Tabs, Cell, List, PullRefresh, ActionSheet, Popup, Search
} from 'vant'
import directives from '@/utils/directives.js'
Vue.config.productionTip = false
Vue.use(directives)
Vue.use(NavBar)
Vue.use(Form)
Vue.use(Field)
Vue.use(Button)
Vue.use(Tabbar)
Vue.use(TabbarItem)
Vue.use(Icon)
Vue.use(Tab)
Vue.use(Tabs)
Vue.use(Cell)
Vue.use(List)
Vue.use(PullRefresh)
Vue.use(ActionSheet)
Vue.use(Popup)
Vue.use(Badge)
Vue.use(Row)
Vue.use(Col)
Vue.use(Search)
new Vue({
  router,
  store,
  render: h => h(App)

}).$mount('#app')
// 定义函数调用axios，axios是请求任务，要使用async，await修饰
// async function myfn () {
//   // try 放可能会出错的代码
//   try {
//     const res = await allChannelListAPI()
//     console.log(res)
//   } catch (err) { // err是回调参数，当错误时返回
//     // catch当try代码报错就会捕获到这里
//     // console.dir(err)
//   }
// }
// myfn()
